package subgroup

import "encoding/xml"

type MCode struct {
	Code         string `json:"code"`
	PaidUpTo     string `json:"paidUpTo"`
	FallbackDate string `json:"fallbackDate"`
	Extended     bool   `json:"extended"`
}
type License struct {
	LicenseId          string  `json:"licenseId"`
	LicenseeName       string  `json:"licenseeName"`
	AssigneeName       string  `json:"assigneeName"`
	AssigneeEmail      string  `json:"assigneeEmail"`
	LicenseRestriction string  `json:"licenseRestriction"`
	CheckConcurrentUse bool    `json:"checkConcurrentUse"`
	Products           []MCode `json:"products"`
	Metadata           string  `json:"metadata"`
	Hash               string  `json:"hash"`
	GracePeriodDays    int     `json:"gracePeriodDays"`
	AutoProlongated    bool    `json:"autoProlongated"`
	IsAutoProlongated  bool    `json:"isAutoProlongated"`
}

type xmlData struct {
	Action                   string `xml:"action"`
	ConfirmationStamp        string `xml:"confirmationStamp"`
	LeaseSignature           string `xml:"leaseSignature"`
	Message                  string `xml:"message"`
	ResponseCode             string `xml:"responseCode"`
	Salt                     string `xml:"salt"`
	ServerLease              string `xml:"serverLease"`
	ServerUid                string `xml:"serverUid"`
	ValidationDeadlinePeriod string `xml:"validationDeadlinePeriod"`
	ValidationPeriod         string `xml:"validationPeriod"`
}

type PingResponse struct {
	XMLName xml.Name `xml:"PingResponse"`
	xmlData
}

type ProlongTicketResponse struct {
	XMLName xml.Name `xml:"ProlongTicketResponse"`
	xmlData
}

type ReleaseTicketResponse struct {
	XMLName xml.Name `xml:"ReleaseTicketResponse"`
	xmlData
}

type ObtainTicketResponse struct {
	XMLName                  xml.Name `xml:"ObtainTicketResponse"`
	Action                   string   `xml:"action"`
	ConfirmationStamp        string   `xml:"confirmationStamp"`
	LeaseSignature           string   `xml:"leaseSignature"`
	Message                  string   `xml:"message"`
	ProlongationPeriod       string   `xml:"prolongationPeriod"`
	ResponseCode             string   `xml:"responseCode"`
	Salt                     string   `xml:"salt"`
	ServerLease              string   `xml:"serverLease"`
	ServerUid                string   `xml:"serverUid"`
	TicketId                 string   `xml:"ticketId"`
	TicketProperties         string   `xml:",innerxml"`
	ValidationDeadlinePeriod string   `xml:"validationDeadlinePeriod"`
	ValidationPeriod         string   `xml:"validationPeriod"`
}

const LicenseRootPublicKey = "657823416415964932845156435107145357714205418747915356734397055242964933221752404166614935255105249101653916721681603662754307632457128805443068644284748929421507178622933348669378235847742899773920765918770105482851534467296284105250512573151705220224379509383835022323282176179690146311979451556541118129344282127375534752754929526193258755897888515754328964698687671896985405008425332766082319260988023654359845072776189451448786758245414253386146246727354454047135428416624852422567360097346671648093064429279847823280592246506886401865455491924420415707803245018138595108029359998829520236522620749918729938206134739331246902031807601266419258080411903201595710155467901291142142443220333539750397923736434950558371997170985472272249812750161962720036837656464089126216749585148030883029438285184930024286517865710539947589764564204842426698322404033441531662829238875205420761652375337327297032255730262635511533223504109798364923988127319356119135982652788834405038113746394301957551167740345788175766290794604666781402329824924118191746319728033878045396093674696713022814027690165596773992550010915823534552020920573926469894452526033833249442230929742486602298477270672101197444729222659891038350303699501280729658274069437"
const RootPublicKey = "860106576952879101192782278876319243486072481962999610484027161162448933268423045647258145695082284265933019120714643752088997312766689988016808929265129401027490891810902278465065056686129972085119605237470899952751915070244375173428976413406363879128531449407795115913715863867259163957682164040613505040314747660800424242248055421184038777878268502955477482203711835548014501087778959157112423823275878824729132393281517778742463067583320091009916141454657614089600126948087954465055321987012989937065785013284988096504657892738536613208311013047138019418152103262155848541574327484510025594166239784429845180875774012229784878903603491426732347994359380330103328705981064044872334790365894924494923595382470094461546336020961505275530597716457288511366082299255537762891238136381924520749228412559219346777184174219999640906007205260040707839706131662149325151230558316068068139406816080119906833578907759960298749494098180107991752250725928647349597506532778539709852254478061194098069801549845163358315116260915270480057699929968468068015735162890213859113563672040630687357054902747438421559817252127187138838514773245413540030800888215961904267348727206110582505606182944023582459006406137831940959195566364811905585377246353"

// JetBraninsCertStr JetBranins自签名证书
var JetBraninsCertStr = "MIIEQDCCAiigAwIBAgIBDTANBgkqhkiG9w0BAQsFADAYMRYwFAYDVQQDEw1KZ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